<% @boolean = 0%>
<% @check.each do |checkdetail| %>
 <% if(checkdetail.studentId== @user.studentId && checkdetail.bookName==@booktable.nameBook && Time.now>= checkdetail.thoigianmuon && Time.now<= checkdetail.thoigiantra)%>
 <% @boolean = 1%>
<%end%>
<%end%>
<% if @boolean == 0 %>
<h1><%= t :newborrow %> </h1>
<%= t(:namebook) %> <%= @booktable.nameBook%>
<br>
<%= t(:borrowtime) %> <%= Time.now.to_date%>
<br>
<%= t(:backtime) %> <%= 10.days.from_now.to_date%>
<br>
<%= link_to t(:back), root_path %>
<%= render 'form' %>
<% else %>
<h1><%= t :damuonsach %> </h1>
 <% end%>